/*
 *  $Id: Phrase.cs 1229 2010-12-05 14:41:22Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008-2010 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

using System;
using System.Collections.Generic;

using Ragima.Languages.PhraseParts;

namespace Ragima.Languages {
    /// <summary>
    /// Фраза на русском языке.
    /// </summary>
    [ResourceLang("ru")]
    public sealed class RussianPhrase : LocalizedPhrase {
        public RussianPhrase(string template) : base(template) {
        }

        private static List<IPhrasePartParser> Parsers = null;

        protected override IEnumerable<IPhrasePartParser> GetParsers() {
            if (Parsers == null) {
                Parsers = new List<IPhrasePartParser>();
                Parsers.Add(new RussianNamePhrasePart.RussianNameParser());
                Parsers.Add(new RussianNumberEndingPhrasePart.RussianNumberEndingParser());
                Parsers.AddRange(base.GetParsers());
            }
            return Parsers;
        }

        /// <summary>
        /// Создает ресурс русской фразы.
        /// </summary>
        public static ResourceItem New(string id, string template) { return new ResourceItem(id, new RussianPhrase(template)); }
    }
}
